package com.xc.h05.service.changlongfei.impl;

import com.xc.h05.entity.*;


import com.xc.h05.mapper.CourseDetailsCLFMapper;
import com.xc.h05.mapper.CoursemarkMapper;
import com.xc.h05.mapper.CoursereplyMapper;
import com.xc.h05.service.changlongfei.CourseDetailsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CourseDetailsServiceImpl implements CourseDetailsService {
    @Autowired
    private CourseDetailsCLFMapper courseCLFMapper;

    @Autowired
    private CoursemarkMapper coursemarkMapper;

    @Autowired
    private CoursereplyMapper coursereplyMapper;
    @Override
    public CourseCLF getCourseDetails(Long id) {
        return courseCLFMapper.selectCourseById(id);
    }

    @Override
    public ConsultCLF getConsultById(Long id) {
        return courseCLFMapper.selectConsultById(id);
    }

    @Override
    public List<CoursemarkCLF> getCoursemarkById(Long id) {
        return courseCLFMapper.selectCoursemarkById(id);
    }

    @Override
    public int addCoursemark(Coursemark coursemark) {
        return coursemarkMapper.insert(coursemark);
    }

    @Override
    public List<CoursetalkCLF> getCoursetalkByIdZuiXin(Long id) {
        return courseCLFMapper.selectCoursetalkByIdZuiXin(id);
    }

    @Override
    public List<CoursetalkCLF> getCoursetalkByIdZuiHou(Long id) {
        return courseCLFMapper.selectCoursetalkByIdZuiHou(id);
    }

    @Override
    public List<CoursetalkCLF> getCoursetalkByIdShuLiang(Long id) {
        return courseCLFMapper.selectCoursetalkByIdShuLiang(id);
    }

    @Override
    public int addCoursereply(Coursereply record) {
        return coursereplyMapper.insert(record);
    }
}
